CMAKE_MINIMUM_REQUIRED(VERSION 3.14)
PROJECT(key_path_analysis)

SET(CMAKE_CXX_FLAGS "-std=c++14 -DROCKSDB_PLATFORM_POSIX -DROCKSDB_LIB_IO_POSIX  -DOS_LINUX -fno-builtin-memcmp -DROCKSDB_FALLOCATE_PRESENT -DGFLAGS=1 -DZLIB -DBZIP2 -DNUMA -DTBB -DROCKSDB_MALLOC_USABLE_SIZE -DROCKSDB_PTHREAD_ADAPTIVE_MUTEX -DROCKSDB_BACKTRACE -DROCKSDB_RANGESYNC_PRESENT -DROCKSDB_SCHED_GETCPU_PRESENT -march=native  -DHAVE_SSE42 -DHAVE_PCLMUL -DROCKSDB_SUPPORT_THREAD_LOCAL")
SET(CMAKE_CXX_STANDARD 14)

# Headers
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../include)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../terark-core/boost-include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../terark-core/3rdparty/zstd)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../terark-core/src)
INCLUDE_DIRECTORIES(/usr/local/include)


LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../output/lib_static)
LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../terark-core/boost-include/stage/lib/)
LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../)

ADD_EXECUTABLE(deleterange deleterange.cc)
TARGET_LINK_LIBRARIES(deleterange rocksdb libboost_filesystem.a libboost_system.a gomp snappy pthread aio lz4 z rt bz2)